<!--
 * @Author: lixb
 * @Date: 2020-09-14 17:24:34
 * @LastEditTime: 2020-09-14 18:17:46
 * @Descripttion: 时令礼包外链页面
-->
<template>
  <div>
    <iframe
      id="slGift"
      :src="url"
      frameborder="0"
      scrolling="auto"
      align="top"
      marginheight="0"
      marginwidth="0"
    ></iframe>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        url: '',
      };
    },
    activated() {
      window.addEventListener('resize', this.resizeIframe);
    },
    deactivated() {
      window.removeEventListener('resize', this.resizeIframe);
    },
    mounted() {
      this.url = this.$route.query.url;
      this.resizeIframe();
    },
    methods: {
      resizeIframe() {
        var winWidth = parseInt(document.documentElement.clientWidth); // 客户端浏览器宽度
        var winHeight = parseInt(document.documentElement.clientHeight); // 客户端浏览器高度
        document.getElementById('slGift').width = winWidth + 'px';
        document.getElementById('slGift').height = winHeight + 'px';
      },
    },
  };
</script>

<style lang="scss" scoped></style>
